﻿@model Banking.Domain.PersonalOperation
@using Banking.Web

@{
    string viewParams = Json.Encode(new { ownerId = Model.Owner.ID });
}

<tr data-entity="operation" data-view="viewPersonal" data-view-params=@viewParams data-id=@Model.ID>
    <td><input type="checkbox" class="itemCheck" data-action="select"/></td>
    <td><span data-action="edit" title="Edit operation «@Model.GetTitle()»" data-sort-key="mark">@Model.Mark</span></td>
    <td><span data-action="edit" title="Edit operation «@Model.GetTitle()»" data-sort-key="amount">@Model.Amount.ToString(Helper.DecimalFormat)</span></td>
    <td><span data-action="edit" title="Edit operation «@Model.GetTitle()»" data-sort-key="share">@Model.GetPersonShare().ToString(Helper.DecimalFormat)</span></td>
    <td><span data-action="edit" title="Edit operation «@Model.GetTitle()»" data-sort-key="description">@Model.Description</span></td>
    <td><span data-action="edit" title="Edit operation «@Model.GetTitle()»"  data-sort-key="date" data-sort-value=@Model.Date.Ticks>@Model.Date.ToString(Helper.DateFormat)</span></td>
    <td>
        <div class="operationPersons">
            <ul data-sort-key = "others" data-sort-value=@Model.Others.Count>
                @foreach (var man in Model.Others)
                {
                    <li>
                        <a href="/@man.Name" title="Go to @man.Name's page">@man.Name</a>
                        @if (Model.Others.Last() != man) { Write(","); } 
                    </li>          
                }
            </ul>
        </div>
    </td>
</tr>